package com.mice.loader
{
	import com.iyimo.event.LoadEvent;
	import com.iyimo.loader.MutilLoader;
	import com.iyimo.manager.SpriteManager;
	
	import flash.display.MovieClip;
	
	/**
	 * urls的格式是{name:value, url:value}
	 */	
	public class SpriteLoader extends MutilLoader{
		public function SpriteLoader(){
			super();
		}
		
		override public function load(value:Array = null):void{
			super.load(value);
			loader.loadSwf(source[_index]["url"]);
		}
		
		override protected function onComplete(e:LoadEvent):void{
			var mc:MovieClip = e.data as MovieClip;
			SpriteManager.addSprite(source[_index]["name"], mc);
			
			super.onComplete(e);
		}
	}
}